using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Attachments
{
    /// <summary>
    /// <para>Generate Attachment Match Table</para>
    /// <para>Creates a match table to be used with the Add Attachments and Remove Attachments tools.</para>
    /// <para>创建用于“添加附件”和“移除附件”工具的匹配表。</para>
    /// </summary>    
    [DisplayName("Generate Attachment Match Table")]
    public class GenerateAttachmentMatchTable : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GenerateAttachmentMatchTable()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_dataset">
        /// <para>Input Dataset</para>
        /// <para>Input dataset that contains records that will have files attached.</para>
        /// <para>包含将附加文件的记录的输入数据集。</para>
        /// </param>
        /// <param name="_in_folder">
        /// <para>Input Folder</para>
        /// <para>Folder that contains files to attach.</para>
        /// <para>包含要附加的文件的文件夹。</para>
        /// </param>
        /// <param name="_out_match_table">
        /// <para>Output Match Table</para>
        /// <para>Table that will be generated which contains two columns: MATCHID and FILENAME.</para>
        /// <para>将生成的表包含两列：MATCHID 和 FILENAME。</para>
        /// </param>
        /// <param name="_in_key_field">
        /// <para>Key Field</para>
        /// <para><xdoc>
        ///   <para>The values in this field will match the names of the files in the input folder. The matching behavior will ignore file extensions, which allows multiple files with various file extensions to match with a single record in the input dataset.</para>
        ///   <para>For example, if the input Key Field value is lot5986, a file on disk named lot5986.jpg would match with this record.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>此字段中的值将与输入文件夹中的文件名称匹配。匹配行为将忽略文件扩展名，这允许具有不同文件扩展名的多个文件与输入数据集中的单个记录匹配。</para>
        ///   <para>例如，如果输入键字段值为 lot5986，则磁盘上名为 lot5986.jpg 的文件将与此记录匹配。</para>
        /// </xdoc></para>
        /// </param>
        public GenerateAttachmentMatchTable(object _in_dataset, object _in_folder, object _out_match_table, object _in_key_field)
        {
            this._in_dataset = _in_dataset;
            this._in_folder = _in_folder;
            this._out_match_table = _out_match_table;
            this._in_key_field = _in_key_field;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Generate Attachment Match Table";

        public override string CallName => "management.GenerateAttachmentMatchTable";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_dataset, _in_folder, _out_match_table, _in_key_field, _in_file_filter, _in_use_relative_paths.GetGPValue()];

        /// <summary>
        /// <para>Input Dataset</para>
        /// <para>Input dataset that contains records that will have files attached.</para>
        /// <para>包含将附加文件的记录的输入数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_dataset { get; set; }


        /// <summary>
        /// <para>Input Folder</para>
        /// <para>Folder that contains files to attach.</para>
        /// <para>包含要附加的文件的文件夹。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Folder")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_folder { get; set; }


        /// <summary>
        /// <para>Output Match Table</para>
        /// <para>Table that will be generated which contains two columns: MATCHID and FILENAME.</para>
        /// <para>将生成的表包含两列：MATCHID 和 FILENAME。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Match Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_match_table { get; set; }


        /// <summary>
        /// <para>Key Field</para>
        /// <para><xdoc>
        ///   <para>The values in this field will match the names of the files in the input folder. The matching behavior will ignore file extensions, which allows multiple files with various file extensions to match with a single record in the input dataset.</para>
        ///   <para>For example, if the input Key Field value is lot5986, a file on disk named lot5986.jpg would match with this record.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>此字段中的值将与输入文件夹中的文件名称匹配。匹配行为将忽略文件扩展名，这允许具有不同文件扩展名的多个文件与输入数据集中的单个记录匹配。</para>
        ///   <para>例如，如果输入键字段值为 lot5986，则磁盘上名为 lot5986.jpg 的文件将与此记录匹配。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Key Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_key_field { get; set; }


        /// <summary>
        /// <para>Input Data Filter</para>
        /// <para><xdoc>
        ///   <para>This parameter is used to limit the files the tool considers for matching. If the file name does not meet the criteria in the file filter parameter it will not be processed and therefore will not show up in the output match table. Wild cards (*) can be used in this parameter for more flexible filtering options. Multiple semicolon-delimited filters can be used as well.</para>
        ///   <para>For example, consider a directory that contains the following files: parcel.tif, parcel.doc, parcel.jpg, houses.jpg, and report.pdf.</para>
        ///   <para>To limit the possible matches in this list to .jpg files, use *.jpg.</para>
        ///   <para>To limit the possible matches in this list to .pdf and .doc files, use *.pdf; *.doc.</para>
        ///   <para>To limit the possible matches in this list to files beginning with parcel, use parcel*.</para>
        ///   <para>To limit the possible matches in this list to files that contain the text arc, use *arc*.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>此参数用于限制工具考虑匹配的文件。如果文件名不符合文件筛选器参数中的条件，则不会对其进行处理，因此不会显示在输出匹配表中。在此参数中可以使用通配符 （*） 以获得更灵活的筛选选项。也可以使用多个分号分隔的过滤器。</para>
        ///   <para>例如，假设一个包含以下文件的目录：parcel.tif、parcel.doc、parcel.jpg、houses.jpg 和 report.pdf。</para>
        ///   <para>若要将此列表中可能的匹配项限制为.jpg文件，请使用 *.jpg。</para>
        ///   <para>若要将此列表中可能的匹配项限制为 .pdf 和 .doc 文件，请使用 *.pdf;*。医生。</para>
        ///   <para>若要将此列表中可能的匹配项限制为以 parcel 开头的文件，请使用 parcel*。</para>
        ///   <para>若要将此列表中可能的匹配项限制为包含文本 arc 的文件，请使用 *arc*。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Data Filter")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_file_filter { get; set; } = null;


        /// <summary>
        /// <para>Store Relative Path</para>
        /// <para><xdoc>
        ///   <para>Determines if the output match table field FILENAME will contain a full path to the dataset or only the file name.
        ///   <bulletList>
        ///     <bullet_item>Checked—The output FILENAME field will contain relative paths. This is the default.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—The output FILENAME field will contain full paths to the data.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>确定输出匹配表字段 FILENAME 是包含数据集的完整路径还是仅包含文件名。
        ///   <bulletList>
        ///     <bullet_item>选中 - 输出 FILENAME 字段将包含相对路径。这是默认设置。 </bullet_item><para/>
        ///     <bullet_item>未选中 - 输出 FILENAME 字段将包含数据的完整路径。</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Store Relative Path")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _in_use_relative_paths_value _in_use_relative_paths { get; set; } = _in_use_relative_paths_value._true;

        public enum _in_use_relative_paths_value
        {
            /// <summary>
            /// <para>RELATIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("RELATIVE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ABSOLUTE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ABSOLUTE")]
            [GPEnumValue("false")]
            _false,

        }

        public GenerateAttachmentMatchTable SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}